# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause

#####################################################################
## QuickShapes Module:
#####################################################################

qt_internal_add_qml_module(QuickShapes
    URI "QtQuick.Shapes"
    VERSION "${PROJECT_VERSION}"
    PLUGIN_TARGET qmlshapesplugin
    NO_PLUGIN_OPTIONAL
    NO_GENERATE_PLUGIN_SOURCE
    CLASS_NAME QmlShapesPlugin
    DEPENDENCIES
        QtQuick/auto
    SOURCES
        qquickshape.cpp qquickshape_p.h
        qquickshape_p_p.h
        qquickshapegenericrenderer.cpp qquickshapegenericrenderer_p.h
        qquickshapesglobal.h qquickshapesglobal_p.h
        qquickshapecurverenderer.cpp qquickshapecurverenderer_p.h qquickshapecurverenderer_p_p.h
        qquickshapesoftwarerenderer.cpp qquickshapesoftwarerenderer_p.h
    LIBRARIES
        Qt::GuiPrivate
        Qt::QuickPrivate
    PUBLIC_LIBRARIES
        Qt::Core
        Qt::Qml
    PRIVATE_MODULE_INTERFACE
        Qt::QuickPrivate
    )

# We need to do additional initialization, so we have to provide our own
# plugin class rather than using the generated one
qt_internal_extend_target(qmlshapesplugin
    SOURCES   qquickshapesplugin.cpp
    LIBRARIES Qt::QuickShapesPrivate
)

qt_internal_add_shaders(QuickShapes "qtquickshapes_shaders"
    SILENT
    BATCHABLE
    PRECOMPILE
    OPTIMIZED
    MULTIVIEW
    PREFIX
        "/qt-project.org/shapes"
    FILES
        "shaders_ng/lineargradient.vert"
        "shaders_ng/lineargradient.frag"
        "shaders_ng/radialgradient.vert"
        "shaders_ng/radialgradient.frag"
        "shaders_ng/conicalgradient.vert"
        "shaders_ng/conicalgradient.frag"
        "shaders_ng/texturefill.vert"
        "shaders_ng/texturefill.frag"
        "shaders_ng/wireframe.frag"
        "shaders_ng/wireframe.vert"
)

if(QT_FEATURE_quickshapes_designhelpers)
    add_subdirectory(designhelpers)
endif()

